﻿{extend name="public:base" /}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <a href="{:url('doSettlementRule')}" class="btn btn-primary btn-lg">新增</a>

                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="iconfont icon-chevron-up"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <div class="row search-form">
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请输入 老师/课程 搜索" name="search_value" value="{:input('search_value')}" type="text" class="form-control form-control-lg">
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group" style="width: 100%; display: flex; justify-content: space-between">
                                <button type="button" class="btn btn-primary btn-lg screen-btn">搜索</button>
                            </div>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>规则名称</th>
                                <th>老师-课程</th>
                                <th>结算周期</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.name}</td>
                                <td>{$vo.teacher} - {$vo.course}</td>
                                <td>
                                    {volist name="vo.config" id="value" key="k"}
                                    <p>第{$k}周期{$value.day}天</p>
                                    {/volist}
                                </td>
                                <td>{$vo.status == 1 ? '启用' : '禁用'}</td>
                                <td>
                                    <a href="{:url('doSettlementRule', ['id' => $vo.id])}" class="btn btn-white btn-sm"><i class="iconfont icon-24"></i> 编辑 </a>
                                    {if $vo.status == 1}
                                    <a href="{:url('settlementRuleStatus', ['id' => $vo.id, 'status' => -1])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-refuse"></i> 禁用 </a>
                                    {else /}
                                    <a href="{:url('settlementRuleStatus', ['id' => $vo.id, 'status' => 1])}" class="btn btn-white btn-sm ajax-operate"><i class="iconfont icon-success"></i> 启用 </a>
                                    {/if}
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

{/block}